package com.iot.ammeter.config;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.extension.injector.methods.additional.InsertBatchSomeColumn;

import java.util.List;

/**
 * @ClassName: ExpandSqlInjector
 * @Author: Basil
 * @Date: 2021/10/21 下午2:31
 * @Version: 1.0
 * @Description: 扩张mybatis-plus，支持批量插入
 **/
public class ExpandSqlInjector extends DefaultSqlInjector {
    /**
     * 获取mapper方法列表
     * @param mapperClass mapper
     * @return List
     */
    @Override
    public List<AbstractMethod> getMethodList(Class<?> mapperClass) {
        List<AbstractMethod> methodList = super.getMethodList(mapperClass);
        methodList.add(new InsertBatchSomeColumn());
        return methodList;
    }
}
